#!/bin/sh

cd $HOME/source/Physics/estat

make clean

#if the below make is successful then have to run the exe and the gnuplot command.

if make estat1
then
	echo "build successful, executing a.out"
	if ./a.out
	then
		 gnuplot plotEfield.gp 2> gnuploterrors.gnulog
		 gnuplot plotPotential.gp 2> gnuploterrors.gnulog
	else
		echo "failure in execution!"
	fi
else
	echo "make fail!!"
fi
